package pack;

public class Controller {

	
public Controller(Handlerable c1Handle, Handlerable c2Handle,
			Handlerable degaultHandler) {
		super();
		this.c1Handle = c1Handle;
		this.c2Handle = c2Handle;
		this.defaultHandler = degaultHandler;
	}

//private Handlerable handler;
private Handlerable c1Handle;
private Handlerable c2Handle;
private Handlerable defaultHandler;




	public void handle (Command command) {
		switch (command) {
		case C1:
			c1Handle.doHandle(command);
			break;
			
		case C2:
			c2Handle.doHandle(command);
			break;

		default:
			defaultHandler.doHandle(command);
			break;
		}
	}

}
